import { defHttp } from '@/utils/http/axios';

export enum qianguaApi {
  getlist = '/dp_group/getlist',
  addtopic = '/dp_group/addtopic',
  initColumns = '/init_columns',
  checkcolumns = '/dp_group/checkcolumns',
  startfetch = '/dp_group/startfetch',
  findone = '/db_group/fineone',
  dplist = '/dp_group/dplist',
}

export const getlist = (params) => defHttp.post({ url: qianguaApi.getlist, params });

export const addtopic = (params) => {
  return defHttp.post({ url: qianguaApi.addtopic, params });
};
export const initColumns = () =>
  defHttp.get<{ qianguaColumns: []; pgyColumns: [] }>({ url: qianguaApi.initColumns });

export const checkcolumns = (params) => defHttp.post({ url: qianguaApi.checkcolumns, params });

export const startfetch = (id: number) => defHttp.get({ url: qianguaApi.startfetch + '/' + id });

export const findone = (id: number) => defHttp.get({ url: qianguaApi.findone + '/' + id });

export const dplist = (params) => defHttp.post({ url: qianguaApi.dplist, params });
